<?php
	
	session_start();
	require_once('common/config.php');
	
	if(!isset($_SESSION['logon']))
	{
		header("Location: /wks/login.php?url=poster");
		exit();
	}
	
	if(!defined('BASE_DIR'))
	  define('BASE_DIR', $_SERVER['DOCUMENT_ROOT']) ;
	  
	$pageCMS = PAGE_CMS_POSTER;
	$poster = simplexml_load_file(BASE_DIR."/xml/poster.xml");
	
	if(!isset($_POST['submit'])){
		require_once('template/poster/poster_view.php');
		exit();
	}
	else
	{
		$poster->item1->link = $_POST['poster_link1'];
		$poster->item1->image = $_POST['poster_img1'];
		
		$poster->item2->link = $_POST['poster_link2'];
		$poster->item2->image = $_POST['poster_img2'];
		
		$poster->item3->link = $_POST['poster_link3'];
		$poster->item3->image = $_POST['poster_img3'];
		
		$poster->item4->link = $_POST['poster_link4'];
		$poster->item4->image = $_POST['poster_img4'];
		
		$poster->item5->link = $_POST['poster_link5'];
		$poster->item5->image = $_POST['poster_img5'];
		
		$poster->asXML(BASE_DIR."/xml/poster.xml");
		header("Location: /wks/poster.php");
	}
?>


